<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="theme-color" content="#33474d">
	<title>CentOS 6 编译安装php 5.4 5.5（lamp模式） | 失落的乐章</title>
	<link rel="stylesheet" href="/css/style.css" />
	
      <link rel="alternate" href="/atom.xml" title="失落的乐章" type="application/atom+xml">
    
</head>

<body>

	<header class="header">
		<nav class="header__nav">
			
				<a href="/archives" class="header__link">Archive</a>
			
				<a href="/tags" class="header__link">Tags</a>
			
				<a href="/atom.xml" class="header__link">RSS</a>
			
		</nav>
		<h1 class="header__title"><a href="/">失落的乐章</a></h1>
		<h2 class="header__subtitle">技术面前，永远都是学生。</h2>
	</header>

	<main>
		<article>
	
		<h1>CentOS 6 编译安装php 5.4 5.5（lamp模式）</h1>
	
	<div class="article__infos">
		<span class="article__date">2017-10-12</span><br />
		
		
			<span class="article__tags">
			  	<a class="article__tag-link" href="/tags/LAMP/">LAMP</a> <a class="article__tag-link" href="/tags/Php/">Php</a>
			</span>
		
	</div>

	

	
		<ol>
<li>下载php5.4</li>
</ol>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">wget http://cn2.php.net/distributions/php-5.4.36.tar.bz2</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href="http://cn2.php.net/distributions/php-5.5.22.tar.bz2" target="_blank" rel="external">5.5下载地址</a></p>
<ol>
<li>解压</li>
</ol>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">tar jxvf php-5.4.36.tar.bz2</div><div class="line"> </div><div class="line"><span class="built_in">cd</span> php-5.4.36</div></pre></td></tr></table></figure>
<ol>
<li>安装yum扩展源</li>
</ol>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">rpm -i <span class="string">'https://www.apelearn.com/bbs/data/attachment/forum/epel-release-6-8_32.noarch.rpm'</span></div></pre></td></tr></table></figure>
<ol>
<li>安装依赖包</li>
</ol>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">yum install libxml2-devel libjpeg-* libpng-devel freetype-devel gd-devel libmcrypt-devel openssl-devel</div></pre></td></tr></table></figure>
<ol>
<li>配置编译参数</li>
</ol>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div></pre></td><td class="code"><pre><div class="line">./configure --prefix=/usr/<span class="built_in">local</span>/php \</div><div class="line"> --with-apxs2=/usr/<span class="built_in">local</span>/apache2/bin/apxs \</div><div class="line"> --with-config-file-path=/usr/<span class="built_in">local</span>/php/etc \</div><div class="line"> --with-mysql=/usr/<span class="built_in">local</span>/mysql \</div><div class="line"> --with-libxml-dir \</div><div class="line"> --with-gd \</div><div class="line"> --with-jpeg-dir \</div><div class="line"> --with-png-dir \</div><div class="line"> --with-freetype-dir \</div><div class="line"> --with-iconv-dir \</div><div class="line"> --with-zlib-dir \</div><div class="line"> --with-bz2 \</div><div class="line"> --with-openssl \</div><div class="line"> --with-mcrypt \</div><div class="line"> --<span class="built_in">enable</span>-soap \</div><div class="line"> --<span class="built_in">enable</span>-gd-native-ttf \</div><div class="line"> --<span class="built_in">enable</span>-mbstring \</div><div class="line"> --<span class="built_in">enable</span>-sockets \</div><div class="line"> --<span class="built_in">enable</span>-exif \</div><div class="line"> --<span class="built_in">disable</span>-ipv6</div></pre></td></tr></table></figure>
<ol>
<li>编译安装</li>
</ol>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">make &amp;&amp; make install</div></pre></td></tr></table></figure>
	

	
		<span class="different-posts"><a href="/2017/10/12/Php/2. CentOS 6 编译安装php 5.4 5.5（lamp模式）/" onclick="window.history.go(-1); return false;">⬅️ Go back </a></span>

	

</article>

	</main>

	<footer class="footer">
	<div class="footer-content">
		
	      <div class="footer__element">
	<p>Hi there, <br />welcome to my Blog glad you found it. Have a look around, will you?</p>
</div>

	    
	      <div class="footer__element">
	<h5>Check out</h5>
	<ul class="footer-links">
		<li class="footer-links__link"><a href="/archives">Archive</a></li>
		
		  <li class="footer-links__link"><a href="/atom.xml">RSS</a></li>
	    
		<li class="footer-links__link"><a href="/about">about page</a></li>
		<li class="footer-links__link"><a href="/tags">Tags</a></li>
		<li class="footer-links__link"><a href="/categories">Categories</a></li>
	</ul>
</div>

	    

		<div class="footer-credit">
			<span>© 2017 失落的乐章 | Powered by <a href="https://hexo.io/">Hexo</a> | Theme <a href="https://github.com/HoverBaum/meilidu-hexo">MeiliDu</a></span>
		</div>

	</div>


</footer>



</body>

</html>
